import { createApp } from 'vue'
import router from '@/router'
import ElementPlus from 'element-plus'
// 全局方法
import GlobalApi from '@/plugins/global'

// @ts-expect-error 防止报错
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

// import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
import '@/styles/index.scss'
// 引入svg图标
import 'virtual:svg-icons-register'

import gloablComponent from '@/components/index'

import App from '@/App.vue'

const app = createApp(App)
app.use(router)
app.use(gloablComponent)
app.use(GlobalApi)
// 挂载全局Element组件
app.use(ElementPlus, { locale: zhCn, size: 'default' })
// for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
//     app.component(key, component)
// }
app.mount('#app')
